Release 10.1A: OpenEdge Development:
ADM and SmartObjects
SmartToolbar usage notes
This section discusses special programming considerations for using SmartToolbars.
SmartPanels as toolbars
In previous ADM releases, a common way to provide toolbar-type functionality in Progress applications was to instance both a Navigation SmartPanel and an Update SmartPanel and use them collectively as a sort of toolbar. If the containing SmartObject is a SmartWindow, this is no longer necessary, as you can now use a SmartToolbar instead.
Complex SmartToolbar modifications
More complex SmartToolbar modifications (for example, the order and structure of icons and menus) involve modifying the SmartToolbar object itself. You manage the layout and availability of actions in a toolbar in the functions
initializeMenu() andinitializeToolbar( ). These functions are not defined in the SmartToolbar super procedure as a default, but they are called from initializeObject and always must exist in the toolbar. Using these functions to customize the SmartToolbar ensures that its structure and layout are defined at the right moment in theinitializeObject( )function.You can override the default behavior of the SmartToolbar in either a local SmartToolbar master or a local SmartToolbar super procedure:
- Local SmartToolbar master — Create a local SmartToolbar master by copying the master (
adm2/dyntoolbar.w), then customize theinitializeMenu( )andinitializeToolbar( )functions as required.Note that if your application requires two or more versions of a SmartToolbar, you can create local masters for each (the local masters must have different names), then update the
.cstfiles accordingly.- Local SmartToolbar super procedure — Create a local SmartToolbar super procedure by copying the super procedure (
adm2/custom/toolbarcustom.p), then customizing its code as required. The code inadm2/dyntoolbar.w’sinitializeMenu( )andinitializeToolbar( )functions callsSUPER( )with the no-error option. If it does not find a super procedure or returns false, the default code is executed.You can use this technique to implement a data-driven SmartToolbar that checks properties (for example,
userandobject) to retrieve the correct SmartToolbar specification data. (If no data is found, returnFALSEto trigger the default behavior.)
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |